//
//  UIView+Additions.h
//  MLIPhone
//
//  Created by yakehuang on 5/10/14.
//
//

#import <UIKit/UIKit.h>
static const void *isGradient = &isGradient;

@interface UIView (Additions)
@property (nonatomic, strong) CAGradientLayer *gradientLayer;
// 设置边距
- (void)setOriginX:(CGFloat)originX originY:(CGFloat)originY;
- (void)setOriginX:(CGFloat)originX;
- (void)setOriginY:(CGFloat)originY;

// 设置高宽
- (void)setWidth:(CGFloat)width height:(CGFloat)height;
- (void)setWidth:(CGFloat)width;
- (void)setHeight:(CGFloat)height;

// 移除所有子view
- (void)removeAllSubViews;

// 找到第一响应者，移除
- (BOOL)findAndResignFirstResponder;
- (UIView *)findFirstResponder;

// 获得所属控制器
- (UIViewController*)viewController;
- (void)showLoading:(NSString *)word;

+ (UIView*)lineView:(CGRect)frame;
+ (UIView *)lineViewWithLyt;
/**绘制虚线
 ** lineView:       需要绘制成虚线的view
 ** lineLength:     虚线的宽度
 ** lineSpacing:    虚线的间距
 ** lineColor:      虚线的颜色
 **/
+ (void)drawDashLine:(UIView *)lineView
          lineLength:(int)lineLength
         lineSpacing:(int)lineSpacing
           lineColor:(UIColor *)lineColor;
- (void)gradientColors:(NSArray*)colors
                  Fram:(CGRect)fram
          cornerRadius:(CGFloat)radius;
- (void)viewBackgroundColorGradientStarColor:(UIColor *)starColor endColor:(UIColor *)endColor frame:(CGRect)frame;
- (UIImage *)convertViewToImage;

- (UIView*)subViewOfClassName:(NSString*)className;

//添加部分圆角
- (void)addTopCorners;
- (void)addBottomCorners;
- (void)addRoundedCorners:(UIRectCorner)corners
               withRadius:(CGSize)radius;
@end
